feat(create-rspack): add type annotations to JS configs#11896
Merged
chenjiahan merged 1 commit intomainfrom Oct 16, 2025
Merged
feat(create-rspack): add type annotations to JS configs#11896chenjiahan merged 1 commit intomainfrom
chenjiahan merged 1 commit intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances type safety for Rspack configuration templates by adding TypeScript type checking to JavaScript configs and improving type annotations in TypeScript configs. The changes help users identify invalid configurations at development time.
- Added
// @ts-checkcomments and JSDoc type annotations to JavaScript config files - Imported and used
SwcLoaderOptionstype withsatisfiesoperator in TypeScript configs - Removed unused import statements from Vue JS template
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/create-rspack/template-vue-ts/rspack.config.ts | Added SwcLoaderOptions import and satisfies type annotation |
| packages/create-rspack/template-vue-js/rspack.config.mjs | Added @ts-check and JSDoc type annotation, removed unused imports |
| packages/create-rspack/template-vanilla-ts/rspack.config.ts | Added SwcLoaderOptions import and satisfies type annotations |
| packages/create-rspack/template-vanilla-js/rspack.config.mjs | Added @ts-check and JSDoc type annotation |
| packages/create-rspack/template-react-ts/rspack.config.ts | Added SwcLoaderOptions import and satisfies type annotation |
| packages/create-rspack/template-react-js/rspack.config.mjs | Added @ts-check and JSDoc type annotation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
✅ Deploy Preview for rspack canceled.
|
Contributor
📦 Binary Size-limit
🙈 Size remains the same at 47.67MB |
2 tasks
CodSpeed Performance ReportMerging #11896 will not alter performanceComparing Summary
|
CPunisher
approved these changes
Oct 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
// @ts-checkand type annotations to JS configs to helping users to identify invalid configurations.SwcLoaderOptionstype in TS configsRelated links
https://www.typescriptlang.org/docs/handbook/intro-to-js-ts.html#ts-check
Checklist